package com.kube;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import org.junit.Test;

public class test {
	@Test
	public void test1(){
		FileInputStream fis =null;
		try{
			File f = new File("e:\\input.txt");
			fis = new FileInputStream(f);
			byte[] b = new byte[1024];
			int i = 0;
			while((i=fis.read(b))>0){
				String str = new String(b,0,i);
				System.out.println(str);
				String[] s = str.split(" ");
				int personNum = Integer.parseInt(s[0]);
				int relationNum = Integer.parseInt(s[1]);
				int[] c1 = new int[relationNum];
				int[] c2 = new int[relationNum];
				for(int j=0; j<relationNum;j++){
					c1[j] = Integer.parseInt(s[3+j]);
					System.out.println("c1"+j+":"+c1[j]);
				}
				for(int j=0; j<relationNum;j++){
					c2[j] = Integer.parseInt(s[4+relationNum+j]);
					System.out.println("c2"+j+":"+c2[j]);
				}
				for(int j=0; j<s.length;j++){
					
				}
			}
			
		}catch(Exception e){
			e.printStackTrace();
		}finally{
			try {
				fis.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
	@Test
	public void test2(){
		FileOutputStream fos = null;
		try {
			File f = new File("e:\\output.txt");
			fos = new FileOutputStream(f);
			String str = "fuwentingshishabi";
			fos.write(str.getBytes());
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			try {
				fos.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}
